<html>
	<head>
		<title>Trombino - note étudiant</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="public/js/jquery.min.js"></script>
		<script type="text/javascript" src="public/js/d3.v2.js"></script>
		<script type="text/javascript">
		//tableau des raisons
		var arrnote = {};

		//enregistrement de la note
		function savenote(note, etu) {
			//récupère les informations de l'étudiant
			var nom = $("#etu_nom_"+etu).text();
			var r = arrnote[note];
			var url = $("#etu_tof_"+etu).attr("src");
			var p = {"note":r, "etu":nom, "url":url};
			/*
			$.get("ecrire.php", p,
					 function(data){
						alert(data);
					 });
			 */
			$.post("public/evaletu/ecrire", p,
					 function(data){
						dataCloud = data;
					 }, "json");
		}
		//dessine le graphe svg
		var clusterer; function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(46.85, 1.75), 6); clusterer = new Clusterer(map); clusterer.SetMaxVisibleMarkers(10); clusterer.SetMinMarkersPerCluster(5); GDownloadUrl("exemple10.json", setup_json); } else { alert("Desole, l'API Google Maps n'est pas compatible avec votre navigateur."); } }
		setup_json = function(json, status) { var data = eval('(' + json + ')'); for (var i=0; i<data.markers.length; i++) { var point = new GLatLng(data.markers[i].lat, data.markers[i].lng); var marker = createMarker(point, data.markers[i].html); clusterer.AddMarker(marker, data.markers[i].html); } }
		var mgr; function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(46.85, 1.75), 6); mgr = new MarkerManager(map); GDownloadUrl("exemple04.json", setup_json); } else { alert("Desole, l'API Google Maps n'est pas compatible avec votre navigateur."); } }
		setup_json = function(json, status) { var data = eval('(' + json + ')'); var markers = new Array(); for (var i=0; i<data.markers.length; i++) { var point = new GLatLng(data.markers[i].lat, data.markers[i].lng); var marker = createMarker(point, data.markers[i].html); markers.push(marker); } mgr.addMarkers(markers, 5); mgr.refresh(); }
		</script>
		
		<style>
		.btn {
			cursor:pointer; 
		}
		.tof {
			width:200px; 
		}
		.good {
			color:green;
		}
		.bad {
			color:red;
		}
		
		div.conteneur { 
		  	text-align:left; /* centrage horizontal */
		  	clear:both;
			border-style:solid;
			border-width:2px;	
		}
		
		div.bloc {
			float:left;
			margin:3px 3px 3px 3px; 	 
		}

		.axis {
		  shape-rendering: crispEdges;
		}
		
		.x.axis line {
		  stroke: #fff;
		}
		
		.x.axis .minor {
		  stroke-opacity: .5;
		}
		
		.x.axis path {
		  display: none;
		}
		
		.y.axis line, .y.axis path {
		  fill: none;
		  stroke: #000;
		}
				
		</style>
		
	</head>
	<body >	
	<?php 
    $xml = simplexml_load_file("trombino.xml");
	
	
	$i=0;
	//foreach ($xml->photo as $item){
	foreach ($xml->channel->item as $item){
		if($i % 2 == 0) $c = 'good'; else $c = 'bad'; 
		
		//$id = $item['id']."";
		//$toto = $item->titi."";
		
		echo "<div id='etu_".$i."' class='conteneur' >";
		echo "<div class='bloc' >";
		echo "<img src='public/img/img1.jpg' class='btn' onclick='saveRaison(1,".$i.")' />";
		echo'<p><label>Exercice<input type="text" name="req_exercice" size="5"maxlength="2" /></label></p>';
		echo'<p><label>Note<input type="text" name="req_note" size="4"maxlength="2" /></label></p>';
		echo'<p><label>Note Pondrée <input type="text" name="req_note" size="4"maxlength="2" /> sur<INPUT type="Nom du champ" value="20"size="3" name="NOTEMAX"> </p>';
		
		
		echo'
    <FORM>
    <INPUT TYPE="submit" NAME="nom" VALUE=" Envoyer ">
    </FORM>';


		echo "</div>";
		echo "<div class='bloc' >";
		echo "<img id='etu_tof_".$i."' src='".$item->enclosure['url']."' class='tof' onclick='getRaison(".$i.")' />";
		echo "<div class='$c' id='etu_nom_".$i."'>".$item->title."</div>";
		echo "</div>";
		echo "<div id='etu_svg_".$i."' class='bloc' ></div>";
		echo "</div>";
		
		$i++;
	}
	?>
	</body>
</html>
